#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDesktopWidget>
#include <QSystemTrayIcon>
#include <QMessageBox>
#include <QMenu>
#include <QCloseEvent>
#include "Settings.h"
#include "Common.h"
#include "Core.h"
#include "LoginDialog.h"


namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void CheckAccount();
signals:
    void CreateDatabase(QString);
    void DeleteDatabase(QString);

private slots:

    void TrayIconActivated(QSystemTrayIcon::ActivationReason reason);

    void on_OptionButton_clicked();

    void on_NewMailButton_clicked();

    void on_ReplyMailButton_clicked();

    void on_TrashMailButton_clicked();

    void on_SignOutButton_clicked();

    void on_SearchButton_clicked();

private:
    Ui::MainWindow *ui;
    Settings set;

    void CreatingAccountWindow();
    void closeEvent(QCloseEvent *);
    void changeEvent(QEvent *event);
    void CreateTrayIcon();

    QSystemTrayIcon *trayIcon;
    QMenu *trayIconMenu;
};

#endif // MAINWINDOW_H
